/********************************************************************************
 * Copyright (c) 2017, 2018 Bosch Connected Devices and Solutions GmbH.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * Contributors:
 *    Bosch Connected Devices and Solutions GmbH - initial contribution
 *
 * SPDX-License-Identifier: EPL-2.0
 ********************************************************************************/

/*
 * generated by Xtext 2.10.0
 */
package org.eclipse.mita.platform.ui

import com.google.inject.Binder
import org.eclipse.mita.base.ui.opener.LibraryURIEditorOpener
import org.eclipse.mita.platform.ui.labeling.PlatformDslEObjectHoverProvider
import org.eclipse.ui.PlatformUI
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor
import org.eclipse.xtext.ui.LanguageSpecific
import org.eclipse.xtext.ui.editor.IURIEditorOpener
import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider
import org.eclipse.mita.base.ui.index.MitaWorkspaceProjectsState

/**
 * Use this class to register components to be used within the Eclipse IDE.
 */
@FinalFieldsConstructor
class PlatformDSLUiModule extends AbstractPlatformDSLUiModule {
	override configureLanguageSpecificURIEditorOpener(Binder binder) {
		if (PlatformUI.isWorkbenchRunning())
			binder.bind(IURIEditorOpener).annotatedWith(LanguageSpecific).to(LibraryURIEditorOpener);
	}
	
	def Class<? extends IEObjectHoverProvider> bindIEObjectHoverProvider() {
		return PlatformDslEObjectHoverProvider;
	}
	override bindIAllContainersState$Provider() {
		return MitaWorkspaceProjectsState.Provider;
	}
}
